home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- global proc string mayaSoftwareGetCommonGlobalValue(
- string $global)
- {
- //
- // Description:
- // This procedure is called when the current renderer has changed from the
- // Maya Software renderer to something else.
- // This procedure returns the value of the common global specified by
- // $global.
- // For a complete list of valid values for the $global argument, and to
- // see how this procedure is used, see copyCommonRenderGlobals.mel.
- //
- // Returns:
- // The value of the specified common global, as a string.
- //
-
- string $value;
-
- switch ($global)
- {
- case "animation":
- $value = `getAttr defaultRenderGlobals.animation`;
- break;
- case "startFrame":
- $value = `getAttr defaultRenderGlobals.startFrame`;
- break;
- case "endFrame":
- $value = `getAttr defaultRenderGlobals.endFrame`;
- break;
- case "byFrame":
- $value = `getAttr defaultRenderGlobals.byFrameStep`;
- break;
- case "framePadding":
- $value = `getAttr defaultRenderGlobals.extensionPadding`;
- break;
- case "renderableObjects":
- if (`getAttr defaultRenderGlobals.renderAll` == 1)
- {
- $value = "all";
- }
- else
- {
- $value = "selected";
- }
- break;
- case "useCustomExtension":
- if (`getAttr "defaultRenderGlobals.outFormatControl"` == 2)
- {
- $value = "1";
- }
- else
- {
- $value = "0";
- }
- break;
- case "customExtension":
- $value = `getAttr defaultRenderGlobals.outFormatExt`;
- break;
- case "renumberFramesUsing":
- $value = `getAttr defaultRenderGlobals.modifyExtension`;
- break;
- case "renumberStartFrame":
- $value = `getAttr defaultRenderGlobals.startExtension`;
- break;
- case "renumberByFrame":
- $value = `getAttr defaultRenderGlobals.byExtension`;
- break;
- case "maintainWidthHeightRatio":
- $value = `getAttr defaultResolution.aspectLock`;
- break;
- case "width":
- $value = `getAttr defaultResolution.width`;
- break;
- case "height":
- $value = `getAttr defaultResolution.height`;
- break;
- case "lockDeviceAspectRatio":
- $value = `getAttr defaultResolution.lockDeviceAspectRatio`;
- break;
- case "deviceAspectRatio":
- $value = `getAttr defaultResolution.deviceAspectRatio`;
- break;
- case "pixelAspectRatio":
-
- float $deviceAspectRatio =
- `getAttr defaultResolution.deviceAspectRatio`;
- float $width = `getAttr defaultResolution.width`;
- float $height = `getAttr defaultResolution.height`;
- float $pixelAspectRatio =
- $deviceAspectRatio * $height / $width ;
- $value = $pixelAspectRatio;
- break;
- case "enableDefaultLight":
- $value = `getAttr defaultRenderGlobals.enableDefaultLight`;
- break;
- case "pluginFormat":
- $value = `getAttr defaultRenderGlobals.pluginFormat`;
- break;
- case "preRenderMel":
- $value = `getAttr defaultRenderGlobals.preRenderMel`;
- break;
- case "postRenderMel":
- $value = `getAttr defaultRenderGlobals.postRenderMel`;
- break;
- default:
- warning(
- "mayaSoftwareGetCommonGlobalValue() was asked for the value "
- + "of a global ("
- + $global
- + ") it does not support. "
- + "Modify mayaSoftwareHasCommonGlobal() to fix the problem\n");
- break;
- }
-
- return $value;
- }
-